<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
function searchIdCheck(obj){
	var a = document.searchId;
	if(!a.searchId.value || a.searchId.value==""){
		alert('검색할 아이디를 입력하세요!');
		a.searchId.focus();
		return false;
	}else{
		return true;
	}
}


function formChk(m_num){
	p_num = document.getElementById("p_num").value;
	if(document.getElementById("m_name").value == ''){
		alert('ID를 검색해서 찾아주세요');
		return false;
	}
	location.href='managerUpdate.do?m_num='+m_num+'&&m_pknum='+p_num;
}



</script>
<form action="memberDetail.do" name="searchId" method="post" onsubmit="return searchIdCheck(this.form)">
	<table border="0" cellspacing="0" cellpadding="2" align="center">
		<tr>
			<td width = "10px">ID</td>
			<td>
				<input type="hidden" id="p_num" name="p_num" value="${param.p_num }">
				<input type="text" name="searchId" value="<c:if test="${not empty msg }">${msg }</c:if><c:if test="${empty msg }">${member.m_id }</c:if>"onclick={this.value=''}>
			</td>
			<td width="2px">
				<input type="submit" value="검색" style="width: 120px;height: 22px">
			</td>
		</tr>
		<%-- <tr>
			<td width = "10px">ID</td><td><input type = "text" id="m_id" value="${member.m_id }" disabled></td><td></td>
		</tr> --%>
		<tr>
			<td width = "10px">NAME</td><td><input type = "text" id="m_name" value="${member.m_name }" disabled></td><td></td>
		</tr>
		<tr>
			<td width = "10px">PHONE</td><td><input type = "text" id="m_phone" value="${member.m_phone }" disabled></td><td></td>
		</tr>
		<tr>
			<td width = "10px">E-MAIL</td><td><input type = "text" id="m_email" value="${member.m_email }" disabled/></td><td></td>
		</tr>
		<c:choose>
			<c:when test="${member.m_level >=2 || member.m_resign == 2}">
				<tr>
					<td colspan="2" align="right"><input type="button" name="keyWord" value="매니저임명" style="width: 120px;height: 22px" disabled></td><td></td>
				</tr>
			</c:when>
			<c:otherwise>
				<tr>
					<td colspan="2" align="right"><input type="button" name="keyWord" value="매니저임명" onclick="return formChk(${member.m_num})" style="width: 120px;height: 22px"></td><td></td>
				</tr>
			</c:otherwise>
		</c:choose>
	</table>
</form>
